{extend name="public/base"/}
{block name="style"}
{/block}
{block name="content"}
<div class="data-list" data-url="{:url('returns')}">
    <form class="layui-form inline-form">
        <div class="pull-left">
            <div class="layui-inline">
                <select lay-filter="data-select">
                    {foreach $order_select as $k=>$v}
                    <option value="{$k}">{$v}</option>
                    {/foreach}
                </select>
            </div>
            <div class="layui-inline">
                <input class="layui-input input-order-sn" autocomplete="off" id="order-sn" name="order_no">
            </div>
            <div class="layui-inline">
                <input class="layui-input laydate-range" placeholder="退货时间" autocomplete="off" name="send_time">
            </div>
            <div class="layui-inline">
                <select name="out_id" lay-search lay-filter="data-list">
                    <option value="">发货仓库</option>
                    {foreach $warehouse as $w}
                    <option value="{$w.warehouse_id}">{$w.name}</option>
                    {/foreach}
                </select>
            </div>
            <div class="layui-inline">
                <select name="in_id" lay-search lay-filter="data-list">
                    <option value="">收货仓库</option>
                    {foreach $warehouse as $w}
                    <option value="{$w.warehouse_id}">{$w.name}</option>
                    {/foreach}
                </select>
            </div>
            <div class="layui-inline">
                <select name="account_id" lay-search lay-filter="data-list">
                    <option value="">销售账号</option>
                    {foreach $account as $a}
                    <option value="{$a.account_id}">{$a.username}</option>
                    {/foreach}
                </select>
            </div>
            <div class="layui-inline">
                <select name="channel_id" lay-search lay-filter="data-list">
                    <option value="">退货渠道</option>
                    {foreach $channel as $c}
                    <option value="{$c.channel_id}">{$c.channel_name}</option>
                    {/foreach}
                </select>
            </div>
            <div class="layui-inline">
                <button class="layui-btn layui-btn-sm layui-btn-normal search"><i class="layui-icon layui-icon-search"></i></button>
            </div>
        </div>
    </form>
    <div class="data">
        <p><i class="fa fa-spinner fa-spin"></i> 加载中...</p>
    </div>
</div>
{/block}
{block name="script"}
<script type="text/javascript">
    layui.use(['layer', 'jquery', 'form'], function()
    {
        var layer = layui.layer
            , $ = layui.jquery
            , form = layui.form;
        form.on("select(data-select)", function(data)
        {
            $("#order-sn").attr('name', data.value);
        });
        $("#order-sn").keydown(function(event)
        {
            if(event.keyCode != 13) return;
            setTimeout(()=>{$(this).val('');}, 100);
        });
    });
</script>
{/block}